package com.hksj.ecm.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * @author zengke
 * @version 1.0
 * @see EnergyRate
 * @since 2024/8/8 16:15
 */

@Data
@TableName("hk_nhjc_energy_rate")
public class EnergyRate {

    /**
     * 能源费率id
     */
    @ApiModelProperty(value = "能源费率id")
    @TableField(value = "id")
    private String id;

    /**
     * 能源类型code
     */
    @ApiModelProperty(value = "能源类型code")
    @TableField(value = "energy_type_code")
    @NotBlank(message = "能源类型代码不为空")
    private String energyTypeCode;

    /**
     * 阶梯名称
     */
    @ApiModelProperty(value = "阶梯名称")
    @TableField(value = "ladder_name")
    private String ladderName;

    /**
     * 范围值起
     */
    @ApiModelProperty(value = "范围值起")
    @TableField(value = "start_range_value")
    @Pattern(regexp = "^(0|[1-9]\\d*)(\\.\\d+)?$",message = "【范围值起】请输入一个非负数")
    private String startRangeValue;

    /**
     * 范围值止
     */
    @ApiModelProperty(value = "范围值止")
    @TableField(value = "end_range_value")
    @Pattern(regexp = "^(0|[1-9]\\d*)(\\.\\d+)?$",message = "【范围值止】请输入一个非负数")
    private String endRangeValue;

    /**
     * 单位费用
     */
    @ApiModelProperty(value = "单位费用")
    @TableField(value = "unit_cost")
    @Pattern(regexp = "^(0|[1-9]\\d*)(\\.\\d+)?$",message = "【单位费用】请输入一个非负数")
    private String unitCost;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date createTime;

}
